<template>
	<u-popup :show="payShow" @close="payShow=false">
		<view class="details_pay">
			<view class="title">
				<text>请选择</text>
				<image src="@/static/index/steamerTicket/icon_close.png" @tap="cancelPay"></image>
			</view>
			<view class="wechat_pay">
				<view class="wp_left">
					<image src="@/static/index/steamerTicket/img_pay.jpg"></image>
					<text>微信支付</text>
				</view>
				<image src="https://i.ringzle.com/file/20240220/ab1b5e0ebe964bdca8b4a6230163e93d.png"></image>
			</view>
			<view class="pay_submit" @tap="confirmPay">确定</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
		options: {
			styleIsolation: 'shared' //样式分离，使组件/deep/下的样式生效
		},
		data() {
			return {
				payShow: false
			}
		},
		methods: {
			cancelPay(){
				uni.showModal({
					title:'温馨提示',
					content:'您的订单尚未完成支付，确定要离开？',
					success: (res) => {
						if(res.confirm){
							this.payShow = false;
							this.$emit('cancelPay');
						}
					}
				})
			},
			confirmPay() {
				this.$emit('confirmPay');
			}
		}
	}
</script>

<style lang="less">
	/deep/.u-popup__content {
		border-radius: 32rpx 32rpx 0 0;
	}

	.details_pay {
		padding: 40rpx 30rpx 55rpx;
		min-height: 400rpx;
		border-radius: 32rpx 32rpx 0 0;
		background: #F6F6F6;

		.title {
			position: relative;
			text-align: center;

			text {
				font-size: 36rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
			}

			image {
				width: 36rpx;
				height: 36rpx;
				position: absolute;
				right: 10rpx;
				top: 50%;
				margin-top: -18rpx;
			}
		}

		.wechat_pay {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 83rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 0rpx 0rpx;
			padding: 41rpx 24rpx;

			.wp_left {
				display: flex;
				align-items: center;

				image {
					width: 54rpx;
					height: 54rpx;
				}

				text {
					font-size: 32rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					margin-left: 24rpx;
				}
			}

			&>image {
				width: 48rpx;
				height: 48rpx;
			}
		}

		.pay_submit {
			margin-top: 59rpx;
			height: 92rpx;
			background: #007A69;
			border-radius: 46rpx;
			line-height: 92rpx;
			text-align: center;
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			letter-spacing: 2rpx;
		}
	}
</style>